package com.smart.gui;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;

public class TOC_Form_Business_Drivers extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7021326681638857271L;

	private JPanel contentPane;

	/**
	 * singleton pattern -- getInstance
	 */
	private static TOC_Form_Business_Drivers uniqueInstanceForm;

	public static synchronized TOC_Form_Business_Drivers getInstance() {
		if (uniqueInstanceForm == null) {
			try {
				uniqueInstanceForm = new TOC_Form_Business_Drivers();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return uniqueInstanceForm;
	}

	/**
	 * Create the frame.
	 */
	public TOC_Form_Business_Drivers() {
		ButtonHandler handler = new ButtonHandler(this);

		setTitle("Table of Contents of Business Drivers Questionnaire");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(100, 100, 450, 165);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane
				.setLayout(new FormLayout(new ColumnSpec[] {
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						ColumnSpec.decode("default:grow"), }, new RowSpec[] {
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC, }));

		JLabel label = new JLabel("1)");
		contentPane.add(label, "2, 4");

		JButton btnGoalAndExpectations = new JButton(
				"Goal and Expectations of Migration");
		btnGoalAndExpectations.setActionCommand(ButtonHandler.GAEOF);
		btnGoalAndExpectations.addActionListener(handler);
		contentPane.add(btnGoalAndExpectations, "4, 4");

		JLabel label_1 = new JLabel("2)");
		contentPane.add(label_1, "2, 6");

		JButton btnBudgetAndSchedule = new JButton("Budget and Schedule");
		btnBudgetAndSchedule.setActionCommand(ButtonHandler.BAS);
		btnBudgetAndSchedule.addActionListener(handler);
		contentPane.add(btnBudgetAndSchedule, "4, 6");

		JLabel label_2 = new JLabel("3)");
		contentPane.add(label_2, "2, 8");

		JButton btnOtherEfforts = new JButton("Other Efforts");
		btnOtherEfforts.setActionCommand(ButtonHandler.OE);
		btnOtherEfforts.addActionListener(handler);
		contentPane.add(btnOtherEfforts, "4, 8");

	}

}
